#{extends 'main.html' /}
 #{set title:'IdeaPage' /}



<script type="text/javascript">
	function showCommentsDiv() {
		$('#commentsDiv').toggle(1000);
	}
	
	$(function() {
		$('#TagBox').hide();
		$('#AddTag').hide();
		$('#Tag').hide();
		$('#TagOptions').hide();
		$('#EditBox').hide();
		$('#Cancel').hide();
		$('#hideTags').hide();
		$('#hideOptions').hide();
		$('#overlay').hide();
		$('#prbtn').hide();
		$('#prioritize').hide();
		$('#CommentsTitle').hide();
		showPrioritize();
	});
	
	
	function showBox() {
		$('#showBox').hide();
		$('#AddTag').show();
		$('#TagBox').show();
		$('#Cancel').show();
	}

	function hideBox() {
		$('#showBox').show();
		$('#AddTag').hide();
		$('#TagBox').hide();
		$('#Cancel').hide();
	}

	function showTags() {
		$('#Tag').show();
		$('#hideTags').show();
		$('#showTags').hide();
		
	}

	function hideTags() {
		$('#Tag').hide();
		$('#showTags').show();
		$('#hideTags').hide();
	}

	function hideOptions() {
		$('#TagOptions').hide();
		$('#EditBox').hide();
		$('#hideOptions').hide();
	}


	function addEditedTag(deleted) {
		id = ${ideaId};
		name = document.getElementById("EditBox").value;
		NoSpace = 1;
		for(i = 0; i < name.length; i++){
			if(name[i] == " "){
				NoSpace = 0;
			}
		} 
		var isAlphaNeumeric =/^[0-9a-zA-Zs ]+$/;
		if(isAlphaNeumeric.test(name)){
		if(NoSpace){
		if(name.length > 25){
			$('#one').jGrowl("Tags should not exceed 25 characters !")
		} else if(name.length == ""){
			$('#one').jGrowl("Tag is empty !");
		}
		else{
		$.getJSON('@{TopicIdeaController.addTag()}',{'name' : name,'ID':id, 'type':"idea"},function(data){
	 	$('#one').jGrowl(data.box);
	 	if ((data.box != "Already Exists") && (data.box != "Tags should not exceed 25 characters !") && (data.box != "Tag is empty !")) {
	 	document.getElementById("Tag").innerHTML += "<input type=\"button\" value=\""+name+"\" id=\""+"Tag"+name+"\" onclick=\"showOptions('"+name+"')\" />";
	 	removeTag(deleted);
	 	document.getElementById("EditBox").value = "";
	 	}
		});}}else {
			$('#one').jGrowl("Tags should not contain any spaces !");
		}} else {
			$('#one').jGrowl("Tags should be of alpha numeric form !");
		}
	}

	function showOptions(tagname){
		document.getElementById("TagOptions").innerHTML = "";
		document.getElementById("TagOptions").innerHTML += "<input type=\"button\" value=\"Edit "+tagname+"\" id=\""+"Edit "+tagname+"\" onclick=\"addEditedTag('"+tagname+"')\" />";
		document.getElementById("TagOptions").innerHTML += "<input type=\"button\" value=\"Remove "+tagname+"\" id=\""+"Remove "+tagname+"\" onclick=\"removeTag('"+tagname+"')\" />";
		//document.getElementById("TagOptions").innerHTML += "<input type=\"button\" value=\"Follow "+tagname+"\" id=\""+"Follow "+tagname+"\" onclick=\"followTag('"+tagname+"')\" />";
		$('#EditBox').show();
		$('#TagOptions').show();
		$('#hideOptions').show();
	}

	function addTag(id) {
		var isAlphaNeumeric =/^[0-9a-zA-Zs ]+$/;
		name = document.getElementById("TagBox").value;
		NoSpace = 1;
		for(i = 0; i < name.length; i++){
			if(name[i] == " "){
				NoSpace = 0;
			}
		}
		if(isAlphaNeumeric.test(name)){
		if(NoSpace){
		if(name.length > 25){
			$('#one').jGrowl("Tags should not exceed 25 characters !")
		} else if(name.length == ""){
			$('#one').jGrowl("Tag is empty !");
		}
		else{
		$.getJSON('@{TopicIdeaController.addTag()}',{'name' : name,'ID':id, 'type':"idea"},function(data){
	 	$('#one').jGrowl(data.box);
	 	if ((data.box != "Already Exists") && (data.box != "Tags should not exceed 25 characters !") && (data.box != "Tag is empty !")) {
	 	document.getElementById("Tag").innerHTML += "<input type=\"button\" value=\""+name+"\" id=\""+"Tag"+name+"\" onclick=\"showOptions('"+name+"')\" />";
	 	document.getElementById("TagBox").value = "";
	 	}
		});}} else {
				$('#one').jGrowl("Tags should not contain any spaces !");	
		}} else {
			$('#one').jGrowl("Tags should be of alpha numeric form !");
		}
	}

	function removeTag(name) {
		document.getElementById("TagOptions").innerHTML = "";
		$.getJSON('@{TopicIdeaController.removeTag()}',{'name' : name,'ID':${ideaId}, 'type':"idea"},function(data) {
		$('#one').jGrowl(data.box);
		showTagTag();
		$('#EditBox').hide();
	});
	}

	function showTagTag(){
		var tags={};
		document.getElementById("Tag").innerHTML ="";
		document.getElementById('overlay').style.height=overlayer()[1]+'px';
		$(document.getElementById('overlay')).fadeIn(1000);
		$(document.getElementById("zeinTag")).fadeIn(1000);
		document.getElementById('zeinTag').focus();
		$.getJSON('@{TopicIdeaController.showTags()}',{'ID':${ideaId}, 'type':"idea"},function(data) {
		if(data.box.length>0){
		tags = data.box.split("$$");
		for(var i = 0 ; i < tags.length ; i=i+1){
	 	document.getElementById("Tag").innerHTML += "<input type=\"button\" value=\""+tags[i]+"\" id=\""+"Tag"+tags[i]+"\" onclick=\"showOptions('"+tags[i]+"')\" />";
	 	 }
		}
	});
	}
	
	function showIdeaTags(id, type){
		var tags={};
		$.getJSON('@{TopicIdeaController.showTags()}',{'ID':id, 'type':type},function(data) {
		tags = data.box.split("$$");
		document.getElementById("IdeaTags").innerHTML = "";
		for(var i = 0 ; i < tags.length ; i=i+1){
			document.getElementById("IdeaTags").innerHTML+= "<a href=\"@{TagPage.TagView()}?name="+tags[i]+"\">" + ""+tags[i]+"" + "</a>   ";
	 	 }
	});
	}

	function hideTagTag(){
		document.getElementById("TagBox").value = "";
		document.getElementById("EditBox").value = "";
		showIdeaTags(${ideaId}, "idea");
		hideTags();
		hideOptions();
		hideBox();
		$(document.getElementById("overlay")).fadeOut(1000);
		$(document.getElementById("zeinTag")).fadeOut(1000);
	}

	function overlayer(){
		 if (document.body.scrollHeight>document.body.offsetHeight){
			 return [document.body.scrollWidth,document.body.scrollHeight];
		 } else {
		 return [document.body.offsetWidth,document.body.offsetHeight];
		}
	}

	function addComment() {
		var isAlphaNeumeric =/^[0-9a-zA-Zs ]+$/;
	    var isAllSpace = /^[\s ]*$/;
		if (document.getElementById("CommentBox").value.length > 256){
	        $('#one').jGrowl("Text too long. Must be 256 characters or less");
	    } else if(document.getElementById("CommentBox").value == ""){
	    	$('#one').jGrowl("Comment box is empty !");
	    } else if(!isAlphaNeumeric.test(document.getElementById("CommentBox").value)){
	    	$('#one').jGrowl("Comments should be of alpha numeric characters only");
	    } else if(isAllSpace.test(document.getElementById("CommentBox").value)){
	    	$('#one').jGrowl("Comment box is empty !");
	    }
		else {
		body = document.getElementById("CommentBox").value.trim();
		$.getJSON('@{TopicIdeaController.addComment()}',{'body' : body, 'ID' : ${ideaId}, 'type': "idea"} ,function(data) {
			commentInfo={};
			commentInfo = data.box.split("!id#");
			document.getElementById("ideaComments").innerHTML += "<br><br><a id=\"CommentUser"+commentInfo[1]+"\" href=\"@{UserProfile.OtherUserProfile()}?userId=${ideaDeveloperId}\">" + '${ideaDeveloperName}' + " said:" + "</a>";
			document.getElementById("ideaComments").innerHTML += "<textarea  id=\"Comment"+commentInfo[1]+"\" disabled=\"true\" rows = \"5\" cols=\"57 max\" style=\"border: 2px solid gray;font:16pt; courier; color:blue; resize:none;\">" +"..:: Comment "+ document.getElementById("commentNumber").value + " ::.. " + body+ " </textarea> "; 
			document.getElementById("ideaComments").innerHTML += "<input type=\"button\" id=\"Report"+commentInfo[1]+"\"  value=\"Report\" onclick=\"reportCommentAsSpam('"+commentInfo[1]+"')\"  /> ";
			document.getElementById("ideaComments").innerHTML += "<input type=\"button\" id=\"Remove"+commentInfo[1]+"\"  value=\"Delete Comment\" onclick=\"removeComment('"+commentInfo[1]+"')\"  />";
			counter = document.getElementById("commentNumber").value;
			counter ++;
			document.getElementById("commentNumber").value = counter;
			document.getElementById("CommentBox").value = "";
		});
		$(("#commentsDiv")).slideUp(1000);
		}
	}
	
	function initalizeIdeaComments(){
		if(document.getElementById("commentFlag").value != "commentsShown"){
		refreshIdeaComments();
		} 
		addComment();
	}
	
	function removeComment (commentID){
		$(("#CommentUser"+commentID+"")).slideUp(1000);
		$(("#Comment"+commentID+"")).slideUp(1000);
		$(("#Remove"+commentID+"")).fadeOut(1000);
		$(("#Report"+commentID+"")).fadeOut(1000);
		$.getJSON('@{TopicIdeaController.removeComment()}',{'ID' : commentID} ,function(data) {
		});
	}
	
	function showRefreshedComments(){
		if(document.getElementById("commentFlag").value != "commentsShown"){
		refreshIdeaComments();
		$(("#ideaComments")).hide();
		$(("#ideaComments")).slideDown();
		} else {
			$(("#ideaComments")).toggle(1000);
		}
	}
	
	function refreshIdeaComments() {
		$('#CommentsTitle').slideDown();
		var commentInfo={};
		var commentCreator={};
		$.getJSON('@{TopicIdeaController.showIdeaComments()}',{'ID':${ideaId}},function(data) {
			document.getElementById("ideaComments").innerHTML = "";
			counter = document.getElementById("commentNumber").value;
			for(var i = 0 ; i < data.length ; i++){
				commentInfo = data[i].split("!id#");
				commentMoreInfo = commentInfo[3].split("!crtr#");
				//$('#one').jGrowl(commentInfo[0] + " has ID " + commentCreator[0] + "and is created by User ID" + commentCreator[1]);
				document.getElementById("ideaComments").innerHTML += "<br><br><a id=\"CommentUser"+commentMoreInfo[0]+"\" href=\"@{UserProfile.OtherUserProfile()}?userId="+commentInfo[2]+"\">" + ""+commentInfo[1]+" said:" + "</a>";
				document.getElementById("ideaComments").innerHTML += "<textarea  id=\"Comment"+commentMoreInfo[0]+"\" disabled=\"true\" rows = \"5\" cols=\"57 max\" style=\"border: 2px solid gray;font:16pt; courier; color:blue; resize:none;\">"+ "..:: Comment " +counter+ " ::.. "+commentInfo[0]+" </textarea>"; 
				document.getElementById("ideaComments").innerHTML += "<input type=\"button\" id=\"Report"+commentMoreInfo[0]+"\"  value=\"Report\" onclick=\"reportCommentAsSpam('"+commentMoreInfo[0]+"')\"/> ";
				if(commentMoreInfo[1] != "NoButton"){
					document.getElementById("ideaComments").innerHTML += "<input type=\"button\" id=\"Remove"+commentMoreInfo[0]+"\"  value=\"Delete Comment\" onclick=\"removeComment('"+commentMoreInfo[0]+"')\"  />";
				}
				counter ++;
			}
			document.getElementById("commentNumber").value = counter;
		});

		document.getElementById("commentFlag").value = "commentsShown";
	}
	
</script>
 <script type="text/javascript">
 function Vote (){
    $("#votesNum").animate({fontSize:"3em"},"fast");

    document.getElementById("votesNum").innerHTML = parseInt(document.getElementById("votesNum").innerHTML) + 1;
    $("#votesNum").animate({fontSize:"1em"},"fast");
    $("#Vote").hide(1000);
    $("#unVote").show(1000);

    voteNw();
};
function unVote(){
   $("#votesNum").animate({fontSize:"3em"},"fast");
    document.getElementById("votesNum").innerHTML = parseInt(document.getElementById("votesNum").innerHTML) - 1;
     $("#votesNum").
         animate({fontSize:"1em"},"fast");
    $("#unVote").hide(10);
    $("#Vote").show(1000);
    unvoteNw();
  };



  function voteNw(){
      $.ajax({
	type: "POST",
	url: '@{TopicIdeaController.voteForIdea()}',
	data: {'ideaId':'${ideaId}'}
	});
         //$('#one').jGrowl("ajax function ra7et succefully");


  }
  
function unvoteNw(){
      $.ajax({
	type: "POST",
	url: '@{TopicIdeaController.unvoteForIdea()}',
	data: {'ideaId':'${ideaId}'}
	})

	}


 </script>
<script type="text/javascript" >
function promoteIdea(){
	$.getJSON('@{TopicIdeaController.promoteIdea()}',{'ideaId':'${ideaId}','ideaDeveloperId':'${ideaDeveloperId}'},function(data){
 		$('#one').jGrowl(data.x);
                if(data.x=="promoted Successfully"){
 		$(document.getElementById("promoteIdea")).hide();
 		$(document.getElementById("demoteIdea")).show();
                document.getElementById("promotionStatus").innerHTML="This Idea is promoted for execution";
                  $('#Vote').hide();
                  $('#unVote').hide();
                   $('#Delete').hide();
             $('#TagActions').hide();
             $('#StartActionPlan').show();
                }
	});
}
</script>
<script type="text/javascript">
function demoteIdea(){
	$.getJSON('@{TopicIdeaController.demoteIdea()}',{'ideaId':'${ideaId}','ideaDeveloperId':'${ideaDeveloperId}'},function(data){
 		$('#one').jGrowl(data.x);
                if(data.x=="demoted Successfully"){
 		$(document.getElementById("promoteIdea")).show();
 		$(document.getElementById("demoteIdea")).hide();
                document.getElementById("promotionStatus").innerHTML="";
                  $('#Vote').show();
               //   $('#unVote').show();
                   $('#Delete').show();
             $('#TagActions').show();
              $('#StartActionPlan').hide();
                }
	});
}
</script>

 <script type="text/javascript" >
     var type1="joinedIdeaDeveloper";
     var type2="NotjoinedIdeaDeveloper";
     var type3="OrgOpen";
    // var type6="deactivatedorganization"
$(document).ready(function display() {
	showIdeaTags('${ideaId}', "idea");
    $('#ShowComments').show();
    if(document.getElementById("type").value==type1 ){
           if('${promote}'==0){
     $('#NewComment').show();
        if('${voted}'==0){
      $('#Vote').show();
        }else{
       $('#unVote').show();
        }
       
         if('${report}'==0){
            $('#Report').show();
        }
        if('${creator}'==1){
            $('#Delete').show();
             $('#TagActions').show();
        }
      $('#MarkDuplicates').show();
     }else{
               document.getElementById("promotionStatus").innerHTML="This Idea is promoted for execution";
               if('${actionPlan}'==1){
               $('#ViewActionPlan').show();
               $('#NewComment').hide();
               } else {
            	   document.getElementById("promotionStatus").innerHTML="This idea is promoted for execution, but no Action Plan is started yet ..";
            	   $('#NewComment').show();
               }
           }

    }
  if(document.getElementById("type").value==type3 ){
     
       if('${promote}'==0){
     $('#NewComment').show();
      $('#TagActions').show();

        if('${voted}'==0){
            $('#Vote').show();
        }else{         
            $('#unVote').show();
             
        }
       
            $('#Delete').show();
            $('#promoteIdea').show();
            document.getElementById("reportIdea").innerHTML='${reportIdea}';

        $('#prbtn').show();
       }else{
          
            document.getElementById("promotionStatus").innerHTML="This Idea is promoted for execution";
           if('${actionPlan}'==0){
            $('#demoteIdea').show();
            $('#StartActionPlan').show();
            $('#NewComment').show();
        }
        else{
          $('#ViewActionPlan').show();
          $('#NewComment').hide();
        }
             
        
        
  }
   
  }
  
  if('${share}'==1){
      $('#Share').show();
  }
  if(document.getElementById("type").value==type2 ){
      document.getElementById("status").innerHTML='${status}';
     if('${promote}'==1){
         document.getElementById("promotionStatus").innerHTML="This Idea is promoted for execution";
         if('${actionPlan}'!=0){
              $('#ViewActionPlan').show();
         }
     }
     }
});


function reportIdeaAsSpam(){
      $.ajax({
	type: "POST",
	url: '@{TopicIdeaController.reportAsSpam()}',
	data: {'id':'${ideaId}','ideaDeveloperId':'${ideaDeveloperId}','type':"idea"}
	});
        $(document.getElementById("Report")).hide();
}

function reportCommentAsSpam(id){
      $.ajax({
	type: "POST",
	url: '@{TopicIdeaController.reportAsSpam()}',
	data: {'id':id,'ideaDeveloperId':'${ideaDeveloperId}','type':"comment"}
	});
    //    $(document.getElementById("Report"+id)).hide();
}

//function deleteIdea(){
  //    $.getJSON('@{TopicIdeaController.deleteIdea()}',{'ideaId':'${ideaId}'},function(data){
 ///		$('#one').jGrowl(data.x);

//	});

//}

function showPrioritize() {
	
	var rbs=document.getElementsByName("priority");
	
	$.getJSON('@{TopicIdeaController.getIdeaPriority()}',{'ideaId':'${ideaId}'}, function(data){
		
		document.getElementById("prlbl").innerHTML=data.result;
		
		for(var i=0;i<rbs.length;i++){
			if(rbs[i].value==data.result)
				rbs[i].checked=true;
			
		}
	});
	
	
	
}

function prioritize(){
	
	var rbs=document.getElementsByName("priority");
	for(var i=0;i<rbs.length;i++){
		if(rbs[i].checked == true) {
			$.getJSON('@{TopicIdeaController.prioritizeIdea()}',{'priority':rbs[i].value,'ideaId':'${ideaId}'}, function(data){
				
				document.getElementById("prlbl").innerHTML=data.result;
				
			});
			break;
		}
	}
	
	$('#prioritize').hide(1000);
}

</script>

<script type="text/javascript">
var freeze = 0;
var follow = 0;
// var a = [document.getElementById("star1"), document.getElementById("star2"), document.getElementById("star3"), document.getElementById("star4"), document.getElementById("star5")]

function mouseonimage(id) {

	for(var i = 0; i < 5; i++) {
		a[i].src = "..\\..\\..\\public\\images\\disabledstar.png";
	}

	for(var i = 0; i < id; i++) {
		
		a[i].src = "..\\..\\..\\public\\images\\redstar.png";
	}

}

function mouseoutimage() {

	for(var i = 0; i < 5; i++) {
		a[i].src = "..\\..\\..\\public\\images\\star.png";
	}

	for(var i = freeze; i < 5; i++) {

		a[i].src = "..\\..\\..\\public\\images\\disabledstar.png";
	}

}

/* function resetstars(){

	for(var i = 0; i < 5; i++) {
		a[i].src = "..\\..\\..\\public\\images\\disabledstar.png";
	}

	freeze = 0;
} */

function loadRate() {
	
	$.getJSON('@{TopicIdeaController.getIdeaRating()}', {'ideaId':'${ideaId}'},function(data){
		document.getElementById("currentRating").innerHTML=data.result;

	});
	
	$.getJSON('@{TopicIdeaController.alreadyRatedIdea()}', {'ideaId':'${ideaId}'},function(data){
		freeze = data.result;
		mouseoutimage();

	});
	
}

function rateIdea(rating) {
	
	$.getJSON('@{TopicIdeaController.rateIdea()}', {'rate':rating , 'ideaId':'${ideaId}'}, function(data) {
	
		freeze = data.result;
		mouseoutimage();
	});
	
	loadRate();
} 

</script>

<script>
function showMembers(){
	if(document.getElementById("members").innerHTML==""){
		id = ${ideaId};
		$.getJSON('@{BrowseController.browseMembersInIdeaOrganization()}', {'ideaId':id}, function(data) {
			var members = "";
			if(data.members != null){
				if(data.members != "-1"){
					var userNames = data.members.split('&&');
					for(var i = 0; i < userNames.length - 1; i = i+1){
						var user = userNames[i]
						members += "<a href='#' onclick=\"shareWith('" + user + "')\">" + user + "</a></br>";
					}
				} else {
					members += "No members to show";
				}
			}
			members += "<input type=\"button\" id=\"hideMembers\" value=\"Done!\" onclick=\"$('#members').fadeOut(1000)\"/>"
			document.getElementById("members").innerHTML = members;
			$('#members').hide();
			$('#members').toggle(1000);
		});	
	} else {
		$('#members').toggle(1000);
	}
}
</script>

<script>
function shareWith(user){
	$.getJSON('@{TopicIdeaController.shareIdea()}', {'recieverUserName':user, 'ideaId':${ideaId}}, function(data){
		$('#one').jGrowl(data.response);
	});
	//$('#members').hide(1000);
}
</script>

    

<style type="text/css">



h5 {
    color: #999999;
    font-size: 13px;
    padding-bottom: 10px;
}

#infoSideBar {
    float: left;
    padding: 10px;
    width: 100px;
}

#infoContainer {
    border-left: 2px solid #DDDDDD;
    float: right;
    padding: 10px;
    width: 450px;
}

#dividedContentContainer {
    border: 2px solid #DDDDDD;
    border-radius: 20px 20px 20px 20px;
    float: left;
    margin: 10px;
    padding: 10px;
    width: 600px;
}

</style>



</head>
<body>
    #{if idea.ideaOrg}
		&nbsp;<a href="@{Application.OrganizationView(idea.ideaOrg.name)}">${idea.ideaOrg.name}</a> 
		
		#{/if}
			
			#{if idea.ideaEnt}
			 <a href="@{Application.OrganizationView(idea.ideaEnt.liesIn.name)}">${idea.ideaEnt.liesIn.name}</a> >
			 <a href="@{Application.EntityView(idea.ideaEnt.id)}">${idea.ideaEnt.name}</a>
			
			#{/if}
			
			#{if  idea.ideaTopic}
			
				#{if idea.ideaTopic.topicOrg}
		<a href="@{Application.OrganizationView(idea.ideaTopic.topicOrg.name)}">${idea.ideaTopic.topicOrg.name}</a> 
		
		#{/if}
			
			#{if idea.ideaTopic.topicEnt}
			 <a href="@{Application.OrganizationView(idea.ideaTopic.topicEnt.liesIn.name)}">${idea.ideaTopic.topicEnt.liesIn.name}</a> >
			 <a href="@{Application.EntityView(idea.ideaTopic.topicEnt.id)}">${idea.ideaTopic.topicEnt.name}</a>
			
			#{/if}
			
			#{/if}
	<div id="content">
		

		<div id="dividedContentContainer">
			<div id="infoSideBar">
                            <h5>
                  <span>Creator:</span>
                           </h5>
                            <a href="#">${creatorName}</a>
                       <h5>
                    numberOfViews: ${numberOfViews}
                                 </h5>

                        </div>
			
                    <div id="infoContainer">
                        <h2> Here is the Idea</h2>
                         Title : <p> ${ideaTitle}</p>
                     Description : <p> ${ideaDescription}</p>
                    </div>
                    
                    
                    </br>
                    <h5><span>Average Rate: </span><span id="currentRating"></span></h5>
								
					<div id="rate">
					
					<a href="javascript:void(0)"> <img id="reset" height="17"
								src="../../../public/images/reset.png" onclick="rateIdea(0)" /></a>  <a
								 href="javascript:void(0)"><img id="star1" height="20"
								src="../../../public/images/disabledstar.png"
								onmouseover="mouseonimage(1)" onmouseout="mouseoutimage()"
								onclick="rateIdea(1)" /></a><a href="javascript:void(0)"><img
								id="star2" height="20"
								src="../../../public/images/disabledstar.png"
								onmouseover="mouseonimage(2)" onmouseout="mouseoutimage()"
								onclick="rateIdea(2)" /></a><a href="javascript:void(0)"><img
								id="star3" height="20"
								src="../../../public/images/disabledstar.png"
								onmouseover="mouseonimage(3)" onmouseout="mouseoutimage()"
								onclick="rateIdea(3)" /></a><a href="javascript:void(0)"><img
								id="star4" height="20"
								src="../../../public/images/disabledstar.png"
								onmouseover="mouseonimage(4)" onmouseout="mouseoutimage()"
								onclick="rateIdea(4)" /></a><a href="javascript:void(0)"><img
								id="star5" height="20"
								src="../../../public/images/disabledstar.png"
								onmouseover="mouseonimage(5)" onmouseout="mouseoutimage()"
								onclick="rateIdea(5)" /></a>
		
						<script>
		
							var a = [document.getElementById("star1"), document.getElementById("star2"), document.getElementById("star3"), document.getElementById("star4"), document.getElementById("star5")];
								
							loadRate();
		
						</script>
		
					</div>
                    
                    <br />
                    Priority: <label id="prlbl"></label>
                    <br />
                    <br />
                    <input type="button" id="prbtn" value="Set Priority" onclick="$('#prioritize').show(1000);"/>
                    <br />
                    <br />
                    <div id="prioritize">
                    
                    <input type="radio" name="priority" value="Critical" /> Critical<br />
                    <input type="radio" name="priority" value="High" /> High<br />
                    <input type="radio" name="priority" value="Medium"/> Medium<br />
                    <input type="radio" name="priority" value="Low" /> Low<br /><br />
                    
                    <input type="submit" value="Update" onclick="prioritize()"/>
                    
                    </div>
		</div>
		
<div id="ideaButtons">
    <label>Number of votes</label>
<a id="votesNum"> ${numberOfVotes}</a>
<br>
<a >date : ${date}</a>
<p></p>
<label id ="status"></label>
<br>
<label id="reportIdea" ></label>
<br>
<label id="promotionStatus"></label>
<br>
<label >idea Tags </label>
<div id="IdeaTags" style="margin-top: 20px"> </div>
<input type="submit" id="ShowComments" style="display:none" value="Show Comments" onclick="javascript:showRefreshedComments()" />
<input type="submit" id="NewComment"  style="display:none" value="New Comment" onclick="javascript:showCommentsDiv()" />
                <input type="submit"
			id="Rate" style="display:none" value="Rate" onclick="" />
                <input type="submit" id="Vote"
		style="display:none" value="Vote" onclick="javascript:Vote()"  />

                <input type="submit" id="unVote"
			style="display:none"  value="unVote" onclick="javascript:unVote()"  />

                <input type="button" id="Delete"
			style="display:none" value="Delete" onclick=location.href='@{TopicIdeaController.deleteIdea(ideaId,"alone")}' />
                <input type="submit" id="TagActions"
			style="display:none" value="Edit Tags" onclick="javascript:showTagTag()" />
                <input type="submit" id="promoteIdea"  style="display:none" value="promote" onclick="javascript :promoteIdea()" />
		<input type="submit" id="demoteIdea" style="display:none" value="demote" onclick="javascript : demoteIdea()" />
                <input type="submit" id="Report" style="display:none" value="ReportAsSpam" onclick="javascript : reportIdeaAsSpam()" />


           <a id="StartActionPlan" style="display:none" href=@{ActionPlanController.StartActionPlan()}?ideaId=${ideaId}>StartActionPlan</a>
            <a id="ViewActionPlan" style="display:none" href=@{ActionPlanController.ActionPlanOrganizer()}?actionPlanId=${actionPlan}>ViewActionPlan</a>


                <input type="submit" id="Share"	value="Share" style="display:none;"onclick="showMembers()" />
             	 <br>
                <form>
				<input type="button" value="Mark Duplicates" style="display:none;" id="MarkDuplicates" class="formbutton" onclick="location.href='@{MarkAsDuplicatesController.markDuplicates()}?id=${ideaId}'"/>
				</form>
		<div id="commentsDiv" style="display: none; margin: 20px;">

			<br> <textarea  id="CommentBox" rows = "3" cols="30 max" style="resize: none;" > </textarea> <input type="submit" name="addComment"
				value="Add Comment" onclick="initalizeIdeaComments()" />

		<input type="hidden" id="type" name="ideaId" value=${type}>
		</div>
				<br>
                <form>
				<input type="button" value="..:: Comments ::.." id="CommentsTitle" class="formbutton"/>
				</form>
				<br>
				
		<div id="ideaComments" style="width: 250px"></div>

<input type="hidden" id="commentNumber" value=1 />
<input type="hidden" id="commentFlag" value="commentsNotShown" />		
<input type="hidden" id="TagToEdit" value=1 />
<div id="zeinTag" style="display:none" class="white_content">
<input type="button" id="showTags" value="Show Tags" onclick="showTags()" />
<input type="button" id="hideOptions" value="Hide Options" onclick="hideOptions()" />
<input type="button" id="hideTags" value="Hide Tags" onclick="hideTags()" />
<input type="button" id="AddTag" value="Add Tag" onclick="addTag(${ideaId})" />
<input type="button" id="showBox" value="Create Tag" onclick="showBox()" />
<input type="text" id="TagBox" value=""/>
<input type="button" id="Cancel" value="Cancel" onclick="hideBox()" />
<input type="button" id="ClosezeinTag" value="x" onclick="hideTagTag()" style="float:right" />
<div id="Tag"></div>
<input type="text" id="EditBox" value=""/>
<div id="TagOptions">
</div>
</div>
<div id ="overlay" style="display:block; position:absolute; top:0px; left:0px; width:100%; height:100%; background-color:black; opacity:.80;">Something here</div>

<div id="members" style="display:none" class="white_content"></div>

</div>
</div>
</body>